Skip to content

feat: support custom request headers#105

Open
javorosas wants to merge 3 commits into
mainfrom
feat/custom-headers
Open

feat: support custom request headers#105
javorosas wants to merge 3 commits into
mainfrom
feat/custom-headers

Conversation

@javorosas
Copy link
Copy Markdown
Member

Summary

  • Add headers to FacturapiOptions so callers can attach custom headers to SDK requests.
  • Merge custom headers into the wrapper defaults while keeping SDK Authorization authoritative.
  • Preserve custom headers for multipart uploads without forcing Content-Type.
  • Bump package metadata to 4.17.0 and add the changelog entry under the existing unpublished 4.17.0 section.

Validation

  • npm run build
  • npm run test:unit
  • npm run test:types

Release note

npm currently has facturapi@4.16.0 as latest, so merging this version bump to main should publish 4.17.0 via the deploy workflow.

@javorosas javorosas marked this pull request as ready for review May 16, 2026 15:13
@javorosas javorosas self-assigned this May 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for supplying custom request headers via Facturapi constructor options, merging them into the wrapper’s defaults while keeping the SDK-generated Authorization header as the intended source of truth across Node and web-like runtimes.

Changes:

  • Add headers to FacturapiOptions and pass them into the request wrapper.
  • Merge custom headers with default request headers and extend runtime compatibility tests to verify behavior (including multipart/FormData requests).
  • Bump version to 4.17.0 and add a changelog entry for the feature.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/web/runtime-compat.web.test.ts Adds web-sim tests asserting custom headers are sent and multipart requests don’t force Content-Type.
test/node/runtime-compat.node.test.ts Adds Node runtime test asserting custom headers are sent and Authorization remains SDK-controlled.
src/wrapper.ts Accepts custom headers in createWrapper and merges them into default headers.
src/index.ts Extends FacturapiOptions with headers and wires it into createWrapper.
package.json Version bump to 4.17.0.
package-lock.json Lockfile version bump to 4.17.0.
CHANGELOG.md Adds changelog entry for custom request headers feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/wrapper.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants